import Mock from "mockjs";
// import user from "./user";
// import system from "./system";
import knowledge from "./resource/knowledge";
import subject from "./resource/subject";
import { MockParams } from "./typing";

//资源模块
const mocks = [...knowledge, ...subject];

//设置延时时间
Mock.setup({
  timeout: "300-600",
});

export function mockXHR() {
  let i: MockParams;
  for (i of mocks) {
    Mock.mock(new RegExp(i.url), i.type || "get", i.response);
  }
}
